package com.villaday.idf.adapter;

import android.content.Context;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.facebook.drawee.view.SimpleDraweeView;
import com.squareup.picasso.Picasso;
import com.villaday.idf.R;
import com.villaday.idf.base.AbsRecyclerViewAdapter;
import com.villaday.idf.util.PhoneUtil;

import java.util.ArrayList;
import java.util.List;


/**
 * Created by tudou on 2018/5/23.
 */

public class GetCirclePageListInnerAdapter extends AbsRecyclerViewAdapter<String> {
    List<ImageView> data=new ArrayList<>();
    public GetCirclePageListInnerAdapter(Context context) {
        super(context, R.layout.item_circleall_rv1_inner);
    }

    @Override
    public void onBindHolder(AbsRecyclerViewAdapter.RecyclerViewHolder holder, String d, int position) {
        ImageView view = (ImageView) holder.getView(R.id.sdv);
        ViewGroup.LayoutParams layoutParams =
                view.getLayoutParams();
        layoutParams.height = (PhoneUtil.getPhoneWidth(context) - PhoneUtil.dp2px(context, 60)) / 3;
        layoutParams.width = (PhoneUtil.getPhoneWidth(context) - PhoneUtil.dp2px(context, 60)) / 3;
        view.setLayoutParams(layoutParams);

        Picasso picasso = new Picasso.Builder(context).loggingEnabled(true).build();
        picasso.load(d)
                .placeholder(R.drawable.img_order)
                .error(R.drawable.img_order)
                .into(view);


    }


    public List<ImageView> getImagList() {
        return data;
    }
}
